﻿using OMG.Fill.Frunit.Model.Ent;
using OMG.Fill.Frunit.Services;
using ProjectShare;
using System.Collections.Generic;
using System.Web.Http;
namespace OMG.Fill.Frunit.Model.UI.Controllers
{
    public class MenuRoleController : ApiController
    {
        MenuRoleServices menuRoleServices = new MenuRoleServices();
        
        //[ApiActionAuthorize("获取角色功能表T_MenuRole分页列表对象操作")]
        //[ApiActionException]
        public Pager<List<MenuRoleEntity>> PostPageList(MenuRoleQuery query)
        {
            return menuRoleServices.GetPageList(query);
        }
        //[ApiActionAuthorize("新增角色功能表T_MenuRole指定对象操作")]
        //[ApiActionException]
        public ResResult<int> Post(MenuRoleModel model) {
            return menuRoleServices.AddInfo(model);
        }
        //[ApiActionAuthorize("修改角色功能表T_MenuRole指定对象操作")]
        //[ApiActionException]
        public ResResult<int> Put(MenuRoleEntity model)
        {
            return menuRoleServices.UpdateInfo(model);
        }
        //[ApiActionAuthorize("删除角色功能表T_MenuRole指定对象操作")]
        //[ApiActionException]
        public ResResult<int> Delete(string id)
        {
            return menuRoleServices.DeleteInfo(id);
        }
        //[ApiActionAuthorize("获取角色功能表T_MenuRole指定对象操作")]
        //[ApiActionException]
        public ResResult<MenuRoleEntity> Get(string id)
        {
            return menuRoleServices.GetModel(id);
        }
        public ResResult<List<MenuRoleEntity>> GetList(string id) {
            return menuRoleServices.GetList(id);
        }
    }
}